const path = require('path')
const htmlWebpackPlugin=require('html-webpack-plugin')
module.exports ={
  //入口文件
  entry:path.join(__dirname,'./src/main.js'),
  //输出文件
  output:{
    //设置输出文件的目录
    path:path.join(__dirname,'./dist'),
    //设置输出文件的名称
    filename:'bundle.js',
  },module:{
    rules:[
      {
        test:/\.css$/,
        use: ['style-loader', 'css-loader']
      },
       {
         test: /\.less$/,
         use: [{
           loader: 'style-loader'
         }, {
           loader: 'css-loader'
         }, {
           loader: 'less-loader'
         }]
       },
      {
        test: /\.scss$/,
        use: [{
          loader: 'style-loader'
        }, {
          loader: 'css-loader'
        }, {
          loader: 'sass-loader'
        }]
      },
      {
        test:/\.(png|hpg|gif|bmp)$/,
        use:'url-loader?limit=5000'
      },
     {
       test:/\.js$/,
       use:'babel-loader'
     },{
       test:/\.vue$/,
       use:' '
     }
    ]
  }, plugins: [
    new htmlWebpackPlugin({
      template: 'index.html',
      filename: 'index.html'
    })
  ]
}